Representing logic gates over Euclidean space via heaviside step function

Theoretical concepts asserted by Alan Turing are the basis of the computation and hence of machine intelligence. Turing Machine, the fundamental computational model, has been proven to be reducible to a logic circuit and, at the same time, portable into a computer program that can be expressed through a combination of fundamental programming language control structures. This work proposes a mathematical framework that analytically models logic gates employing Heaviside Step Function. The existence of a correspondence between a generic finite-time algorithm and the proposed mathematical formulation is proven. The proposed interpretation is given through a well-defined logical circuit analytical expression. Relevant geometrical applications, related to polygon processing, having wide implications in engineering branches are presented together with a new Penalty Method for constrained optimization problems handling. A detailed simulation campaign is conducted to assess the effectiveness of the applications derived from the proposed mathematical framework.

• The correspondence between a finite-time algorithm and its analytical form, by means of the proposed framework, is proved. In particular, a definition of the LGs over Euclidean space is given through the HSF, namely HSFG. Further, for the sake of applicability, an equivalent smoothed form of the obtained results is also presented by employing the logistic function. An interpretation of the fundamental control structures, i.e., sequence, selection, and iteration, is also given. • Geometrical problems previously described, together with some other geometrical applications, are tackled from an analytical perspective, thus avoiding the development of specific algorithms. Specifically, computation of volume of intersecting loci is deeply investigated to demonstrate how the mathematical construction naturally leads back to the HSFGs employment. • A new Penalty Method to handle non-convex and even constrained optimization problems is studied. The resulting cost function requires to be probed by means of optimization techniques 21 or Artificial Intelligence Search Algorithms (SAs) 22 which are able to pick the optimum or quasi-optimum solution in the output space. Intersection points finding between two implicit curves is proposed as concrete geometrical application.
Without loss of generality, Genetic Algorithm (GA) 23 is used in all the investigated applications which require optimization. Nevertheless, arbitrary SA can be adopted since the proposed framework is orthogonal with respect to the algorithm used. Moreover, since the problems are handled from an analytical perspective, a direct comparison with other algorithmic solutions is not in the scope of this work. Nonetheless, conducted numerical simulations thoroughly evaluate the aforementioned contributions, in order to prove the effectiveness of the proposal. To the best of authors' knowledge, such results have never been retrieved before. The present work is organized as follows: "HSF Boolean logic" introduces mathematical definitions and properties of LGs realized through HSF. "Continuous HSF circuit definition" discusses continuous representation of HSF adopted. "HSP control structures" establishes a relation between algorithms and proposed gates. With "Geometrical applications", formulation of the solutions to a set of envisioned problems is given. Section "HSF penalty method", instead, presents a new Penalty Method for constrained optimization problems based on examined notions. Section "Numerical evaluation", analyses numerical results derived from theoretical concepts discussed. Finally, "Conclusion" concludes the work and draws future works and research perspectives.

HSF Boolean logic
In this Section, a mathematical characterization is addressed to achieve a proper definition of LGs functions realized by �(x) , i.e HSF. Information is carried by x, and its binary description is achieved through a discrimination with respect to a threshold, i.e. zero value. In the most complicated case �(x) could not be defined for x = 0 . On the contrary, the upcoming concepts will result in a exemplification. HSF circuit definition. Without loss of generality, let the possible inputs be described with a vector space over a real scalar field, i.e. R D , and O = {x ∈ R D |∃ j : 1...D ∋ ′ x j = 0} . Therefore, the definition of the function that encodes the real inputs in binary information is: where B = {0, 1} . Let R ≥ 1 ∈ N , N 1 = D and N R+1 = Q . Then, it is necessary to define the following sets as: where O r+1 is the analogous of O for any arbitrary input x ∈ R N r+1 , r acts in the same manner as 0 , and R is the rank, i.e. the number of compositions the HSF Circuit (HSFC) will be made of. Moreover, g r , r : 1...R must {N r |r : 1...R + 1, N r ∈ N}, These kernels have to be excluded, because � � r ( � h r ( � � 0 (x) ∈ Ker(h r )) would not be defined. Obviously, the only argument that has to be checked is h 1 if the rank is R = 1. Therefore, if K is the union of all kernels, the proposed definition of a HSFC H of rank R is: is the input string. If �(0) is defined, then the previous definition also holds in K . Indeed, this is a Boolean function with input 0 x . The set of these functions does not have a group structure. However, the set is closed with respect to the composition operation. In the spirit of this notation, the most trivial circuit is the identity which is obtained by setting R = 1 and D = Q: derived from Eq. (4) with: where ξ ∈]0, 1[ D being an arbitrary parameter which takes into account the fact that �(0) may not be defined or may be different from zero. This translation allows to have K = K(h 1 ) = K(y − ξ ) = ∅.

Remark 1 Similar considerations can be done for any set of functions
..R , that encodes in binary the information, by substituting � � i (·) in the chain of composition. Indeed, � � i (·) can be another HSFC.
Fundamental HSF gates. It is worth defining an equivalent LG standard basis L = {NOT, AND, OR} with the use of Eq. (4). The HSF representation of L is defined as the unitary rank (R = 1) basis H = {N, , } , constituted by the fundamental HSFGs. These particular circuits are: • NOT: • AND: with ξ ∈]0, 1[. As a matter of fact, for a given binary input y , the output of any HSFG of H is the same of its correspondent LG in L . Again, the absence of a definition of �(0) is taken into account thanks to ξ. Theorem 1 Let y∈ B D \K be the input of a HSFG H R . Then, there must exist a logic circuit C such that C(y) = H R (y) where C(y) is the output of C receiving y.
Proof According to the definition of H , each function of this set has an I/O relation which has an exact correspondence with the truth table of its analogous in L . Since L can reproduce any truth table of any logic circuit C via composition of its LGs, then the same must hold for H . This means that any HSFG H R determines an I/O relation which must be reproducible through a composition of functions in L .

Corollary 1 NAND is capable of constructing any HSFC via compositions, because it must be as fundamental as
H . The same also holds for NOR. Recalling Remark 1, these can be obtained by composing elements from the H basis, in the following manner:

Continuous HSF circuit definition
The HSF is not suited for contexts and applications in which the differentiability of the functions is required. Several continuous approximations are available but, in this article, the proposed substitution is: where α is a coefficient that should be set sufficiently high and σ is the Sigmoid Function (SF), which has been widely used in engineering and physics applications 24,25 . The difference between the two functions, depicted in Fig. 1, is defined as: where ϑ 0 = �(0) . It can be compactly reformulated as www.nature.com/scientificreports/ δ 0 = δ α (0) is not taken into account, since in this formulation δ 0 = 0 , independently of ϑ 0 . δ α is an odd function in R * and it is odd in R only if δ 0 = 0 : this means that (15) is odd in R . Moreover, δ α goes exponentially to zero ∀x � = 0 if α → ∞ . At the same time, it goes exponentially to zero ∀α > 0 when x → ±∞ and its 1-norm is 2 ln (2) α . Therefore, the difference between �(·) and σ (α·) is small if α is large. The continuous version of a circuit, namely SF Circuit (SFC), is now seen as a function of a real input: and {� g r : [0, 1] N r → R N r+1 } r is a set of uniformly continuous functions. Since the logistic function is defined ∀x ∈ R , the circuit can clearly accept any x ∈ R D . Until the end of this Section, the following will be considered as functions of x , i.e.
. The uniform convergence of a SFC to its correspondent HSFCs can be proven, provided that some considerations are taken into account. The function � 0 (x) splits the domain in Q k D-cubes, with k : 1...2 D , and it assumes a constant vector value within each Q * k = Q k \O . Now let R be the rank of a given circuit H R . Since any composition (which H R is made of) factorizes the domain no further than the action of 0 , and since any inner argument of the composition is a constant within the reduced D-cube Q * k , then ∀r � h r (x) ≡ � h r • � � 0 (x) = � c r,k ∀x ∈ Q * k , i.e. ∀r � h r Q * k = � c r,k . However, to have a proper definition of h r in Q * k , it must be that ∀q : 1..r − 1 : h u q (x) = c u q,k � = 0 ∀u : 1..N q+1 , with u labelling the components of the vector h r . Otherwise, the action of q is not defined in Q * k , implying dom(H R ) ∩ Q * k = ∅ . Therefore, if the previous happens ∀k : 1..2 D , it must be concluded that dom(H R ) = ∅ . This whole argument is an equivalent picture in the input domain of the kernels defined in (2). Now, let X t = {x ∈ R D ∋ ′ |x j | ≥ t ∀j : 1...D} with t > 0 and define X t,k := X t ∩ Q k .
Moreover, to get an estimation of the error committed in the evaluation of H R α (x) in place of a given H R (x) , the circuits may be regarded as functionals with respect to either σ α or . As a consequence, the notation is trivial, and the variational Taylor series reads: Scientific Reports | (2022) 12:8009 | https://doi.org/10.1038/s41598-022-11941-y www.nature.com/scientificreports/ This series is convergent, and it collects both the error and the discontinuity in the functional derivatives. In the case of interest, the parameter ǫ is set to one for the equality to hold, but the variation δ α has been proved to be small, so it is expected that the majority of the discrepancy has to be caused by the first orders. Finally, thanks to this analysis, it is possible to define � σ basis which is equivalent to H but exploiting the logistic function. The fundamental SF Gates (SFGs) that constitute this new basis are N α , � α , � α for which Corollary 2 still holds.

HSP control structures
Once defined the analytical structure of a general SFG, a correlation can be established between them and algorithms. John E. Savage proved the following, which appears as Theorem 3.8.1 of 4 .

Theorem 3 Any computation performed by a one-tape Turing machine M, deterministic or nondeterministic, on an input string w in T steps using m b-bit memory cells can be simulated by a circuit C M,T over the standard complete basis of size and depth O(ST) and O(T log S), respectively, where S = mb is the storage capacity in bits of M's tape. For the deterministic TM the inputs to this circuit consist of the values of w. For the nondeterministic TM the inputs consist of w and the Boolean choice input variables whose values are not set in advance.
Based on the above Theorem, the following is proved.

Theorem 4 Let P be a program or an algorithm which computes a function in a finite amount of time. Then, there must exist an equivalent HSFG H.
Proof Recalling Böhm-Jacopini's Theorem, P is equivalent to TM M and can be expressed through a combination of the three fundamental control structures: sequence, selection and iteration. Therefore, reminding Theorem 3 it is possible to state that there exists a logic circuit C equivalent to M. Finally, considering Theorem 1 can be claimed that there must exist a HSFC H which is equivalent to C. Hence, control structures must also have a correspondent expression in these terms.
A slight interpretation is presented hereby. However, it does not pretend to be mathematically rigorous as it will considered for future investigations. The proposed characterization is proved to be sufficient for the description of control structures which compose a finite-time algorithm. For this reason, the states of all variables and operations can be expressed through Boolean strings and HSFCs, respectively. This means that a set of commands is translated into a set of HSFCs {H R r r } r:1...S , and to execute this set in sequence means: where x OUT and x IN are the state variable before and after the sequence. The selection, instead, is inherently addressed by HSF. In fact, given logical conditions which have to be verified, this control structure can be described through a HSFC H R . This returns 1 if the conditions are not satisfied and 0 otherwise. The mathematical expression is: where f 1 and f 0 are the statements executed in false and true cases, respectively.
Finally, for what concerns finite iteration, the definition of a recursive function turns to be necessary:

This synthetizes into
In fact, once the n-th step is reached, all the others have to be . . . and this happens if the following condition is satisfied: with L ⊆ B D being the domain of the inputs.

Geometrical applications
In this Section, a set of geometrical applications derived from previous theoretical discussion are deeply investigated.
Computation of volume measure covered by intersecting geometrical loci. The first application studied enables the computation of the volume of the union of different loci. The whole mathematical process is deeply described hereby and it is concluded with the equivalent interpretation in terms of HSFGs. Consider a finite set of geometrical loci, described with where x is the generic coordinate in the space R D in which the loci are embedded and q n is a point in the the vector space of parameters which specifies the locus. Addressing the point q n with index n is equal to consider such a point and its dimensionality to be independent from all the others. It is also assumed that f n identifies a closed and compact volume The aim is to find an expression which describes the volume that is effectively encompassed by the set of loci, namely Clearly, the major difficulty stands in the fact that the sum of the measures counts the intersections among different V n a certain number of times, which will be later studied. Obviously, in the trivial case in which no intersections are present Otherwise, in order to obtain µ V from µ S , each intersecting region has to be subtracted in an appropriate way. In other words, intersections have to be counted just once. For instance, consider a D = 2 scenario in which three squares S i , i : 1..3 intersect in region R i , i : 1..3 as shown in Fig. 2. Assuming v as the measure of the unit square, µ S is equal to 48v, while µ V = 30v.
As previously stated, the measure of each intersection region has to be subtracted a certain number of times that is equal to their multiplicity κ . But first, the characteristic function of the n-th volume has to be introduced: According to the definition of the Heaviside used in this formula, the points verifying f n = 0 count as ϑ 0 that is usually equal to 1 or 1/2, but they also may be not counted at all if ϑ 0 is 0 or NaN. Then, the multiplicity of a point x is defined as follows: In particular, the multiplicity of a point x * which belongs just to one volume is κ(x * ) = 0. In fact, each point of M that does not belong to any V n has -1 multiplicity, thus incorrectly increasing µ S . A third addendum which rectifies this behaviour is needed: As a matter of fact, the integrand is equal to 1 ∀x ∋ ′ f n > 0 ∀n . The parameter ξ is a shift that imposes the aforementioned behaviour. Indeed, points which do not belong to any volume return a value which is different from 0 according to the adopted definition of Heaviside: Basically, as the results in (28)(33)(34) are brought together: The expression above can be rewritten in a more compact manner. It is worth noting that (33) is equivalent to The exchange between the sum and integral signs can be always done if N is finite, and also for N → ∞ under the hypothesis of Fubini's Theorem. Moreover, the first integrand is equal to 1 for every point belonging to V n at fixed n and it is 0 elsewhere. Therefore, the whole first addendum is equivalent to (28). Hence, (36) becomes: Recalling results achieved in "HSF Boolean logic", it is clear that (38) is the following HSFGs composition: which does not correspond to any element of the H basis. However, it can be described by Algorithm 1 thanks to Theorem 4. Finally, this leads to: www.nature.com/scientificreports/ which perfectly describes (27). This expression, as stated in Corollary 2, is also equivalent to

Remark 2
The characteristic function may not be defined on the locus f n = 0 due to the definition of ϑ 0 . Nonetheless, the measure of a volume does not depend on the value assumed by ϑ 0 because such value concerns the border which is a zero measure set.

Remark 3
It is worth noting that is sufficient to change the sign of the argument of all HSFs in Eq. (41) to characterize the dual formula for the computation of the intersection among all volumes, that is: Again, recalling Corollary 2, an equivalent expression is that well describes (43). Considering (18), introduce the variable z = α n (σ α + ǫδ α )(−f n ) − ξ and consider that any term d k dǫ k z , k ≥ 2 is zero, therefore it will not be written. As the same time, it can be reasonably assumed that the perturbation is zero at the border and, as a consequence, terms which are border-related are zero too.
Hence, it can be written: www.nature.com/scientificreports/ Moreover, d n dz n δ α (z) = − d n dz n σ α (z) because of the definition of δ α , so the first and third addenda for k ≥ 2 simplify at every term. Let z ′ be equal to z(ǫ = 0) = n σ α (−f n ) − ξ and manipulate the following: Finally, as d dǫ z = α n δ(−f n ) and the index of the Taylor series is moved back, it results that Custom D-dimensional volumes. Another interesting application of Heaviside is the possibility to represent customizable volumes. In fact, the technique presented in previous Section is not limited just to analytical functions. Without loss of generality, consider D = 2 . Suppose that this desired area is defined by a closed polygonal chain of N segments, each of them lying on a given line described by f n (or the vertical line x = c , where c is a constant value). Clearly, �(f n ) is a binary representation of the inequality f n ≥ 0 , because the equation �(f n ) = 1 is satisfied only in a subspace of R 2 . Capitalizing the concept of AND HSFG described in "HSF Boolean logic", the customizable area is cast with the following characteristic function: This concept does not rely on choice of f n as these can be anything, as long as X = 1 encompasses a non-zero finite area. It is worth noting that with this formulation the Point-in-Polygon problem is inherently addressed by evaluating (50) in the desired location.

Remark 4
Reminding results of "Continuous HSF circuit definition", also for this application is possible to define an equivalent SF form X σ , taking advantage of � σ .

Remark 5 It should be noticed that
represents a general partition of input domain into a certain number of disjointed sub-domains of arbitrary shape.

Custom D-dimensional borders.
According to the formulation proposed so far, a further important result is achieved when the objective is not to calculate the volume but to have an expression of its border. Once again, it is sufficient to exploit the AND HSFG. It is necessary that ϑ 0 = 0 to distinguish the locus of interest in the following manner: where Y is the generic characteristic function which can be composed in one of the several ways previously discussed. In practise, when two face-to-face Heavisides are multiplied, the only geometrical locus that has nonzero value is the desired border. In other words, an equality constraint is imposed as will be seen in the next Section. In particular, if ϑ 0 = {0, 1} then it is just needed:  52) and (53) are not satisfied at the intersections of borders, except for Eq. (52) when ϑ 0 = 1.
Another way to realize this locus is the substitution defined in (13) so that previous formulation is equivalent to: where Y σ is the characteristic function expressed via SF. Still, intersections do not belong to Ŵ . If the limit is not taken, an interesting behaviour arises in the proximity of intersections due to the analyticity of σ: For instance, consider the configuration in Fig. 3. It consists of a square centered in [2 2] T and a circle in [1 0] T which intersect in [1 1] T . Therefore, the Y σ in Eq. (55) is the sum of the characteristic functions of the square and the circle. The former is made with Eq. (50) and the usual substitution (13), while the latter is done with Eq. (31). As α increases, Ŵ α gets closer to the real intersection. The presence of the error owed to α results to be negligible, and even advantageous: the proposed formulation represents an optimum analytical approximation of the union border, which in principle (i.e. the exact border) should have no defined gradient at the intersection points.

HSF penalty method
In this Section, an alternative representation of constrained-optimization problems is proposed. This is possible thanks to binary logic granted by HSF. Let us have a cost function A(q) that has to be minimized and it is subject to some equality and inequality constraints Let's pretend, for a while, that the minima of A are different from zero. This hypothesis does not represent a restriction and the lack of it will be handled hereafter. Indeed, usually the cost function has some practical and physical meaning, therefore those minima reasonably lie within a known range. Assuming also that ϑ 0 = 1 , it is possible to write the following expression: As in Penalty Methods, the problem is reformulated as an unconstrained one by taking into account a so-called penalty function 26 . The proposed approach takes care of constraints by exploiting AND HSFG. Indeed, previous formulation is equivalent to: (57) www.nature.com/scientificreports/ As a matter of fact, the resultant function is zero across the whole space where they are not fulfilled, and it coincides with the cost function itself when they are satisfied. Moreover, each equality constraint is enabled through an AND HSFG having in input two face-to-face inequalities. The requirement ϑ 0 = 1 which was stated before is herein clarified. With this assumption, gates return 1 when the weak inequalities g i (q) ≤ 0 are satisfied. As a consequence, it also allows the equality constraints h j (q) to actually work. Otherwise, in both cases zero is provided. This behaviour reproduces the binary logic where the two levels are 0 and A(q) itself. Thus, the usage of the first level has to be denied. Indeed, if some minima are expected to be zeroes of A , it is just needed to shift F sending A into A + c . Clearly, the minimal obtained values have to be shifted back after they have been found. The composition F cannot be globally convex because any of its second-order partial derivatives involves the second derivative of SF with respect to its argument. Therefore, convex optimization methods are not as well-suited as Heuristic SAs. However, these could need to move in a smooth manner between the two spaces (in which the constraints are satisfied or not). To this aim, once again, substitution (13) is necessary and hence SFGs have to be used instead of corresponding HSF forms. In this manner, an exponential slope is given to F , and it will depend on α . In particular, each equality constraint has to be multiplied by a factor 4 because the two σ of which is composed of would give 1/2 each, when it is satisfied. The obtained function F and the optimization process are described by the pseudo-code in Algorithm 2.

Algorithm 2 Optimization Process
Input: A, Q, g, h Output: q * 1: SA(F, Q) 2: 3: function F(A, q ∈ Q, g, h) 4: if g i (q) < 0 ... and g m (q) < 0 and h j (q) = 0 ... and h (q) = 0 then return 0 or asymptotically equal to A(q)e −α 8: end function This method represents an alternative with respect to standard optimization, because the constraints are included in such a way that they are not constraints anymore, but a part of the whole function. Therefore, it is possible to avoid the check of the Karush-Kuhn-Tucker 27 necessary conditions, because they rely on the construction of the Lagrangian while F is formally unconstrained. Thus, computation of weights concerning the classical inclusion of constraints is avoided. Most importantly, as a final remark, this method allows constraints also to be put in any other logical relation.

Curves intersections.
A useful geometrical application of proposed HSF Penalty Method (HSFPM) is to find how many and which intersections there are when two or more curves lie in the same locus. The methodology presented hereby is suitable in the case of two curves, but can be iterated in case of more. Consider f 1 , f 2 and X = {x i ∈ R ∀i : 1..N MAX } and Y = {y i ∈ R ∀i : 1..N MAX } , where N MAX is the maximum intersections number (see Bézout's Theorem 28 ). The optimization problem can be stated as follows where ζ is a user-defined minimum distance to distinguish intersection points. This is a non-convex optimization problem that is hard to solve even with mathematical approximation. The technique proposed in this Section can be used to reformulate the problem as: where A SA can be used to solve this problem.
Basically, every intersection point corresponds to a maxima of the objective function. Moreover, a �(·) has been introduced in the objective function derived from (P1) in order to assure that local maxima are avoided in (P2), and the function value will now be equal to the number of intersections which the algorithm finds. In www.nature.com/scientificreports/ fact, every other point which is not a real intersection would not change the discrete function value. However, as it was previously remarked, �(·) has to be substituted with σ (α·) in order for the algorithm to decently move in the solution domain and α has to be relatively small. As a consequence, the points in excess would increase the function value in an undefined manner. So, it is necessary to introduce a new integer parameter N which counts the real intersections. As the previous sum and products now extend up to N, one more addendum P is introduced as a penalty cost for having increased N, but in such a way that it must be convenient to pay it if a true intersection is found. To this aim it is necessary to also multiply the objective function for a weight W, such that: The worst case scenario is when the algorithm tries to count a point at a distance ζ from a true intersection as if it was a real one. The requirement in Eq. (58) prevents such unwanted behaviour, as it imposes that when a fake intersection is found the reward gained has to be lower than inflicted penalty. For instance, to achieve this goal, (P2) can be reformulated as: where J kj is now made with the substitution (13). Despite aforementioned solution, others can be investigated.

Numerical evaluation
In this Section, theoretical results discussed in past Sections are evaluated. In particular, a wide simulation campaign has been carried out to analyze each possible application derived from discussed previous notions. The adopted hardware consists of a desktop computer equipped with Intel i7 970 and 16GB RAM. In all the optimization-based applications, GA implemented in MATLAB R2020a, is employed as SA of reference. For the sake of generality, measurement units are simplified to pure numbers.
Volumes measure error analysis. In order to evaluate results obtained in "Computation of volume measure covered by intersecting geometrical loci", a reference scenario is taken into account. Given the general equation of a circle the aim is to compute the union area of C 1 = C(−1, 0, 1) and C 2 = C(1, 0, 1) , which are external tangent, placed in a mesh 4x2. This task can be done exploiting Eq. (40): First, the integral has been calculated in MATLAB through the Riemann Summation, with a mesh precision ρ = 10 −4 . The exact result of the area should be 2 πR 2 ≃6.28318 but, due to the precision used, the experimental one is ≃6.28313. This evaluation considers HSFGs that have a discontinuity in 0 that does not represent a problem as stated in Remark 2. However, when SFGs are used, α has an non-negligible impact on the error as discussed in "Computation of volume measure covered by intersecting geometrical loci".
As expected Fig. 4 shows that, fixed the mesh precision, the error of σ (·) , with respect to �(·) , decreases as α increases. Moreover, the first two orders shown demonstrate that (i) the high-order derivatives accounts for lower α error (ii) for α ≥ 10 the error is negligible.  Similarly, it is possible to build the other two squares S 2 and S 3 . The integrand of Eq. (40) is shown in Fig. 5. As previously mentioned, the edges of the volume have a value of 1/2 that is exactly σ (0) . Finally, exploiting Eq. (40), with ρ = 10 −3 , α = 10 3 and a mesh 8x8, the calculated area is 29.99998.

HSF penalty method.
To probe results of "HSF Penalty Method" two simulations of different complexity have been done. The first involves two fixed circles C 1 = C(−2, 0, 1) and C 2 = C(2, 0, 1) placed in a 8x8 mesh. A third one, defined as C 3 = C(x, y, 1) has to be positioned in order to maximize the total covered area. Taking advantage of Eq. (40) and (13), V σ is defined as the SF variant of the Heaviside's one.
The task is accomplished by the objective function: where α = 10 3 and ρ = 5 ×10 −2 . The locus in which the center [x y] T of C 3 has to be placed to maximize the total covered area is shown in Fig. 6. As expected, the center should not be in proximity of the two pre-positioned circles.
The second experiment emulates a constrained simple scenario in which a drone, equipped with a camera, has to take off and land in the same spot. Throughout the mission, the drone has to pursue a trajectory and scan the maximum possible ground area which is composed of camera shoots over the (x, y)-plane. It is assumed that the drone cannot exceed a maximum speed, it flies at constant altitude and the ratio of acquired images is constant and set to unity.  where N is the number of circles C n , whereas X and Y are the sets of centers n : 2..N − 1 coordinates of which trajectory is made of. The start/end points are settled to [−2 − 2] T . Since the acquisition ratio is set to unity, the speed v of the drone corresponds to the distance that is travelled between two consequent points.
Motivated by Eq. (56), it is possible to reformulate the problem stated above as: where The test has been run in a 4x4 mesh with precision ρ = 10 −2 , N = 7 circles, v MAX = 1.5 and α = 10 2 .
Results of the solution of this problem are shown in Fig. 7. Based on solution found by the algorithm, the area covered is ∼11.5. Due to the applied constraint, projected areas are overlapped and cut by the mesh borders. It also results that the adopted speed in each segment is about the maximum possible because, indeed, it minimizes the overlaps.

Custom D-dimentional volumes.
In the previous Subsection an interesting pattern has been obtained in terms of covered area. The associated X σ can be useful to test results achieved in "Custom D-dimensional borders". The outcome of this simulation is shown in Fig. 8, using a 5x5 mesh, ρ = 10 −3 and α = 10 3 . It is worth noting that, even if holes are present in the union of volumes, this is not a problem and a union border Ŵ can always be realized.
In both cases, the returned vector of solution contains the ordered set of information being: the number N of actual intersections (2 and 6 respectively) followed by the related coordinates and then the fake N MAX − N ones. Experimentally, it is important to mention that as the complexity of the involved scenario increases, the research of intersections gets harder in the sense that some runs may not found all of them. In particular, when two or    www.nature.com/scientificreports/ more intersection are close, distinguishing becomes an hard process that could be overcome as fine-tolerance algorithms are used. Another essential note is correlated with custom volumes and, specifically, for what concern oblique segments. On a trial basis, outcomes of simulations confirm that α related to these pieces of volumes should be set not greater than 10 with the aim of speed up the SA operations.

Conclusion
The present work discussed a mathematical characterization of binary logic granted by the HSF. Then, an analytical representation through logistic function has been studied. Furthermore, the existence of a correlation between the conceived mathematical structure and a finite-time program has been proved. Based on these concepts, different geometrical applications and a Penalty Method for constrained optimization problems has been deeply investigated. First, the measure of binary operations among D-volumes is presented. These can also be designed in a custom manner so that a compact region is encompassed by a set of loci. Hence, it is even possible to obtain the border analytical expression of the desired D-volume. Finally, a novel Penalty Method has been realized allowing the reformulation of a constrained non-convex optimization problem in an unconstrained one.